package com.example.humbernav;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Home extends Activity implements OnClickListener {
	private Button btnMapActivity;
	private Button btnRouteActivity;
	private Button btnDirectoryActivity;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);
		btnMapActivity = (Button) findViewById(R.id.btnMapActivity);
		btnMapActivity.setOnClickListener(this);
		btnRouteActivity = (Button) findViewById(R.id.btnRouteActivity);
		btnRouteActivity.setOnClickListener(this);
		btnDirectoryActivity = (Button) findViewById(R.id.btnDirectoryActivity);
		btnDirectoryActivity.setOnClickListener(this);
		initialize();
	}

	public void onClick(View v) {
		if (v == btnMapActivity) {
			startActivity(new Intent(Home.this, MapActivity.class));
		} else if (v == btnRouteActivity) {
			startActivity(new Intent(Home.this, RouteActivity.class));
		} else if (v == btnDirectoryActivity) {
			startActivity(new Intent(Home.this, DirectoryActivity.class));
		}
	}

	/** * Initialize all the static classes */
	private void initialize() {
		Map.initialize();
		Positioning.initialize();
	}
}